<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title>博客系统-后台管理</title>
<link rel="stylesheet" href="./public/admin/css/pintuer.css">
<link rel="stylesheet" href="./public/admin/css/admin.css">
<script src="./public/admin/js/jquery.js"></script>
<script src="./public/admin/js/pintuer.js"></script>
<script src="./public/admin/js/respond.js"></script>
<script src="./public/admin/js/admin.js"></script>

</head>
<body>
<div class="lefter">
    <div class="logo"><a href="#" target="_blank"><img src="./public/admin/images/logo.png" alt="后台管理系统" /></a></div>
</div>
<div class="righter nav-navicon" id="admin-nav">
    <div class="mainer">
        <div class="admin-navbar">
            <span class="float-right">
                <a class="button button-little bg-main" href="/" target="_blank">前台首页</a>
                <a class="button button-little bg-yellow" href="?p=admin&c=Land&a=Out">注销登录</a>
            </span>
            <ul class="nav nav-inline admin-nav">
                <li class="active"><a href="?p=admin" class="icon-home"> 开始</a>
                    <ul>
                        <li class="ax"><a href="?p=admin&c=Class&a=List">分类管理</a></li>
                        <li class="active" ><a href="?p=admin&c=Article&a=List">文章管理</a></li>
                        <li class="ax"><a href="?p=admin&c=Mege&a=List">留言管理</a></li>
                        <li class="ax"><a href="?p=admin&c=Setup&a=List">站点管理</a></li>
                        <li class="ax"><a href="?p=admin&c=Connect&a=List">友情链接</a></li>
                        <li class="ax"><a href="?p=admin&c=User&a=List">用户管理</a></li>
                    </ul>
                </li>
            </ul>
        </div>
        <div class="admin-bread">
            <span>您好，<?php echo $_SESSION['user_name'];?>，欢迎您的光临。</span>
            <ul class="bread">
                <li><a href="?p=admin" class="icon-home"> 开始</a></li>
                <li>后台首页</li>
            </ul>
        </div>
    </div>
</div>

<div class="admin">
	<form action="#" method="POST">
    <div class="panel admin-panel">
    	<div class="panel-head"><strong>文章列表</strong></div>
        <div class="padding border-bottom">
            <input type="button" class="button button-small checkall" name="checkall" checkfor="id[]" value="全选" />
            <a href="?p=admin&c=Article&a=Add"> <input type="button" id="btnAdd" class="button button-small border-green" value="添加文章" /></a>
            <input type="submit" class="button button-small border-yellow"  value="批量删除" />
        </div>
        <table class="table table-hover">
        	<tr>
                <th width="45">选择</th>
                <th width="120">所属类别</th>
                <th width="400">文章标题</th>
                <th width="70">点击率</th>
                <th width="180">发布时间</th>
                <th width="180">作者</th>
                <th width="100">评论管理</th>
                <th width="100">操作</th>
            </tr>
            <?php foreach($data as $value):?>
            <?php
                $art_id = $value['art_id'];
                 $sql_num = "select count(*) as art_num from discuss where art_id = $art_id";
                $num = $this->dao->fetchRow($sql_num);
            ?>
            <tr>
                <td><input type="checkbox" name="id[]" value="" /></td>
                <td><?php echo $value['col_content'];?></td>
                <td><?php echo $value['art_title'];?></td>
                <td><?php echo $value['art_num'];?></td>
                <td><?php echo date('Y-m-d H:i:s',$value['aer_time'])?></td>
                <td><?php echo $value['art_name'];?></td>
                <td><a href="?p=admin&c=Discuss&a=list&art_id=<?php echo $art_id;?>"><?php echo $num['art_num']?></a></td>
                <td>
                    <a class="button border-blue button-little" href="?p=admin&c=Article&a=Update&art_id=<?php echo $value['art_id'];?>">修改</a>
                    <a class="button border-yellow button-little" href="?p=admin&c=Article&a=Delete&art_id=<?php echo $value['art_id'];?>" >删除</a>
                </td>
            </tr>
            <?php endforeach ?>
        </table>
		<div class="panel-foot text-center">
            <?php echo $page->create();?>
        </div>
    </div>
    </form>
    <br/>
</div>
</body>
</html>